import studentCacheData from '../cacheData/studentList.json'
import settings from './settings'
const student = {
    state:{
        //测试数据
        cacheData:studentCacheData,
        //是否有操作栏
        isBar:true,
        isBarShow:false,
/*         数据表格配置
        key:表头字段名
        label:显示信息
        width:列宽度
        fixed：固定列属性
        type：搜索控件属性
        search：是否加入搜索条件
        selectOption 下拉菜单哪个状态里的数据
        searchValue：搜索控件输入的值
        searchKey:对应接口入参的key */
        tableOption:[
            {key:"studentId",label:"编号",width:"",fixed:"left",type:"text",search:false,requestKey:"",searchValue:""},
            {key:"nickName",label:"姓名",width:"",fixed:"left",type:"text",search:true,selectOptionValue:"",requestKey:"userName",searchValue:""},
            {key:"schoolName",label:"所属机构",width:"",fixed:"left",type:"select",search:true,selectOption:"school",selectOptionValue:settings.sexData,requestKey:"schoolName",searchValue:""},
            {key:"phonenumber",label:"手机号码",width:"",fixed:false,type:"text",search:false,requestKey:"phonenumber",searchValue:""},
            {key:"address",label:"地址",width:"500",fixed:false,type:"text",search:true,requestKey:"",searchValue:""},
            {key:"idCardNo",label:"身份证号",width:"200",fixed:false,type:"text",search:true,requestKey:"",searchValue:""},
        ],
        //表格操作栏配置
        tableBarOption:[
            {label:"查看资料",type:"select",business:"",icon:"el-icon-tickets"},
            {label:"完善资料",type:"edit",business:"business:student:edit",icon:"el-icon-tickets"},
            {label:"删除",type:"remove",business:"business:student:remove",icon:"el-icon-delete"},
        ],
        //表格工具栏配置
        tableButtonOption:[
            {label:"导入",type:"import",business:"business:student:import",icon:"el-icon-upload2"},
            {label:"导出",type:"export",business:"business:student:export",icon:"el-icon-download"},
            {label:"新增",type:"add",business:"business:student:addStudent",icon:"el-icon-plus"},
        ],
        //用户编辑列保存的数据
        tableOptionSave:[],
/*         表单配置
        key:表头字段名
        label:显示信息
        width:控件宽度
        fixed：固定列属性
        type：控件属性
        state：是否显示
        value：控件输入的值
        selectOption 下拉菜单哪个状态里的数据 */
        formOption:[
            {key:"studentId",label:"编号",width:"",type:"text",state:false,value:"",required: false,requestKey:""},
            {key:"userName",label:"姓名",width:"",type:"text",state:true,value:"",required: true, message: "请输入姓名", trigger: "blur",requestKey:"nickName"},
            {key:"sex",text:"",label:"性别",width:"",type:"radio",state:false,selectOption:"",value:"",selectOptionValue:"",required: true, message: "请选择性别", trigger: "blur",requestKey:"sex"},
            {key:"school",text:"",label:"所属机构",width:"",type:"select",state:true,selectOption:"school",selectOptionValue:"",value:"",required: true, message: "请选择学校", trigger: "change",requestKey:"school"},
            {key:"phonenumber",label:"手机号码",width:"",type:"text",state:true,value:"",required: true, message: "请输入手机号", trigger: "blur",requestKey:"phoneNo"},
            {key:"idCardNo",label:"身份证号",width:"200",type:"text",state:true,value:"",required: true, message: "请输入身份证号", trigger: "blur",requestKey:"idCardNo"},
            {key:"address",label:"籍贯",width:"200",type:"text",state:true,value:"",required: true, message: "请输入籍贯", trigger: "blur",requestKey:"address"},
            {key:"uploadType",label:"上传类型",width:"200",type:"text",state:false,value:"3",required: false,requestKey:"uploadType"},
            {key:"timestamp",label:"身份证上传时间",width:"200",type:"text",state:false,value:"",required: false,requestKey:"timestamp"},
            // {key:"avatar",label:"头像",width:"200",type:"text",state:true,value:"",required: true, message: "请上传头像", trigger: "blur"},
            // {key:"avatar",label:"头像",width:"200",type:"text",state:true,value:"",required: true, message: "请上传头像", trigger: "blur"},
            // {key:"avatar",label:"头像",width:"200",type:"text",state:true,value:"",required: true, message: "请上传头像", trigger: "blur"},
        ],

    },
    mutations: {
        //添加删除编辑列保存的数据
        setTableOptionSave:(state, saveKey) =>{
            state.tableOptionSave=saveKey
        }
    }
}
export default student

